package com.springcloud.demo.servera.server.fallback;

import com.springcloud.demo.base.vo.ResultVO;
import com.springcloud.demo.servera.server.IServerBFeign;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class ServerBFallbackFactory implements FallbackFactory<IServerBFeign> {

    @Override
    public IServerBFeign create(Throwable cause) {

        return new IServerBFeign() {

            @Override
            public ResultVO<String> get() {
                return ResultVO.ok("降级测试...");
            }

            @Override
            public ResultVO<String> insert() {
                return ResultVO.ok("降级测试...");
            }
        };
    }
}
